To use localization, start by following the steps in the [Flutter Localization guide](https://docs.flutter.dev/accessibility-and-localization/internationalization). When the guide says to create an .arb file, enter the following into `lib/l10n/amplify_en.arb`:

```json
{
  "signin": "Sign In - Localized!",
  "@signin": {
    "description": "Label of the button to sign in the user."
  }
}
```

Then, to add support for another language, create a another file for that language. For example, to add Spanish support, create a file at `lib/l10n/amplify_es.arb`, and add the following:

```json
{
  "signin": "Iniciar Sesión"
}
```

This example only updates the 'Sign In' button. To find the full schema for Authenticator-compatible `.arb` file(s), you can check the default `.arb` files that come packaged with the Amplify Authenticator in the [`/src/l10n/src/`](https://github.com/aws-amplify/amplify-flutter/tree/main/packages/authenticator/amplify_authenticator/lib/src/l10n/src) directory.

Next, import the following in the `./lib/main.dart` file:

```dart
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
```

Then create a `ButtonResolver` and pass it to an `AuthStringResolver`, and in turn pass this to the Authenticator API:

```dart
class LocalizedButtonResolver extends ButtonResolver {
  const LocalizedButtonResolver();

  /// Override the signin function with a localized value
  @override
  String signin(BuildContext context) {
    return AppLocalizations.of(context).signin;
  }
}

const stringResolver = AuthStringResolver(
  buttons: LocalizedButtonResolver(),
);

return Authenticator(
  stringResolver: stringResolver,
  child: // ...
);
```

Finally, update your MaterialApp:

```dart
return MaterialApp(
  title: 'Authenticator Demo',
  theme: ThemeData.light(useMaterial3: true),
  darkTheme: ThemeData.dark(useMaterial3: true),
  localizationsDelegates: const [
    AppLocalizations.delegate,
  ],
  supportedLocales: const [
    Locale('en'), // English
    Locale('es'), // Spanish
  ],
  builder: Authenticator.builder(),
  home: const Scaffold(
    body: Center(
      child: Text('You are logged in!'),
    ),
  ),
);
```

There may be some analysis exceptions in your IDE because, as the Flutter instructions note, Flutter will automatically generate the files at build time. You may need to enable automatic code generation by setting `generate: true` in your app's `pubspec.yaml` file.
